package 设计模式.创建型模式.简单工厂;

import 设计模式.创建型模式.简单工厂.Implement.AMouse;
import 设计模式.创建型模式.简单工厂.Implement.BMouse;

public class SimpleFactoty {
    private static IMouse mouse;

    public static IMouse getInstace(String name){
        if ("华为".equals(name)){
            mouse = new AMouse();
        }else if("联想".equals(name)){
            mouse = new BMouse();
        }
        return mouse;
    }

    /**
     * 多方法的简单工厂
     */
    public static IMouse getAMouse(){
        mouse = new AMouse();
        return mouse;
    }
    public static IMouse getBMouse(){
        mouse = new BMouse();
        return mouse;
    }
}
